// This is autogenerated file. Do not edit!

package models.autogenerated;

class UsersInfo
{
	var db : orm.Db;
	var orm : models.Orm;
	public var id : String;
	public var username : String;
	public var first_name : String;
	public var second_name : String;
	public var pinned_sentence : String;
	public var image_src : String;
	public var join_date : Float;
	public var last_login : Float;

	public function new(db:orm.Db, orm:models.Orm) : Void
	{
		this.db = db;
		this.orm = orm;
	}

	public function set(username:String, first_name:String, second_name:String, pinned_sentence:String, image_src:String, join_date:Float, last_login:Float) : Void
	{
		this.username = username;
		this.first_name = first_name;
		this.second_name = second_name;
		this.pinned_sentence = pinned_sentence;
		this.image_src = image_src;
		this.join_date = join_date;
		this.last_login = last_login;
	}

	public function save() : Void
	{
		db.query(
			 'UPDATE `users_info` SET '
				+  '`username` = ' + db.quote(username)
				+', `first_name` = ' + db.quote(first_name)
				+', `second_name` = ' + db.quote(second_name)
				+', `pinned_sentence` = ' + db.quote(pinned_sentence)
				+', `image_src` = ' + db.quote(image_src)
				+', `join_date` = ' + db.quote(join_date)
				+', `last_login` = ' + db.quote(last_login)
			+' WHERE `id` = ' + db.quote(id)
			+' LIMIT 1'
		);
	}
}